package cn.tedu.front.details.controller;


import cn.tedu.common.web.JsonResult;
import cn.tedu.front.details.pojo.vo.CompanyVO;
import cn.tedu.front.details.service.ICompanyService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.spring.web.json.Json;

@RestController
@Slf4j
@RequestMapping("/company")
@Validated
@Api(tags = "2.公司描述")
public class CompanyController {
    @Autowired
    private ICompanyService companyService;
    @GetMapping("/v1/companyDetail")
    @ApiOperation("根据id查询公司详情内容")
    @ApiOperationSupport(order = 450)
    @ApiImplicitParams({
           @ApiImplicitParam(name = "id", value = "公司文章ID", required = true, dataType = "long")
    })
    public JsonResult getCompanyById(Long id){
        log.debug("开始处理【根据ID查询文章】的请求，参数：{}", id);
        CompanyVO queryResult = companyService.getCompanyById(id);
        return JsonResult.ok(queryResult);
    }
}
